Doorway Safety sheets for

Back to Main Page\n"; # read in link information // // $deptdir = opendir( $deptdirectoryname ); if( $deptdir ) { $infofiles = readdir( $deptdir ); while( $infofiles ) { //echo "$infofiles
\n"; // debug if( preg_match( "/\.info$/", $infofiles) && !preg_match( "/[\._]bak/", $infofiles ) ) // && !preg_match( "/[\._]bak/", $infofiles ) { $location = preg_split("/\./", $infofiles); list( $bldg, $room ) = preg_split("/_/", $location[0]); $links[$bldg] .= $room . '--'; } $infofiles = readdir( $deptdir ); } closedir( $deptdir ); }else { echo "Couldn't open directory.
\n\n\n"; exit(); } # department information next... # $departmenthtml constructed above # from current department $bldgs = array("ABB", "BSB", "JHE", "JHEA"); $floors = array("Basement", "First Floor", "Second Floor", "Third Floor", "Fourth Floor"); $floornum = array("B", "1", "2", "3", "4"); # write body of html echo "\n\t"; sort($bldgs ); foreach( $bldgs as $building ) # start of outer html list of buildings { echo "\n\n\n"; } # end of row and table echo "\n
\n

$building

\n"; # step through floors for ($count=0; $count<5; $count++ ) # start of innner html list { echo "${floors[$count]}\n\t
    \n"; chop( $links[$building] ); $rooms = preg_split( "/--/", $links[$building]); # cycle through all rooms for this building sort( $rooms ); foreach($rooms as $sortedrooms ) # floor is indicated by first character of room { $thisfloor = strtoupper(substr($sortedrooms, 0, 1)); if($thisfloor == $floornum[$count]) # is it on this floor { $sortlocation = strtoupper($building . '_' . $sortedrooms); # construct link filename //$linkname = "http://sirius.physics.mcmaster.ca/php4_scripts/safety/SafetySheet1.php4?location=$sortlocation"; # construct link filename $pdflinkname = "http://sirius.physics.mcmaster.ca/php4_scripts/safety/SafetySheet1.php4?location=$sortlocation"; //$pdflinkname = "http://www.physics.mcmaster.ca/safety/SafetySheet1.php4?location=$sortlocation"; $reviselinkname = "http://www.physics.mcmaster.ca/safety/genform.php4?getbuilding=$building&getroom=$sortedrooms"; $unstripsortedrooms = preg_replace( "/%SLASH%/", "/", $sortedrooms ); $href = "$unstripsortedrooms-revise, pdf"; $href .= "" . ': ' . $dept; //$href = "" . strtoupper($sortedrooms) . ""; echo "\t
  • $href
  • \n"; } } # end of room list for this floor echo "\t
\n"; } # end of floor list for this building echo "
\n"; echo "Back to Main Page\n"; ?>